package com.hejie.commentservice.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class CommentDTO {
    private Long id;

    @NotNull(message = "视频ID不能为空")
    private Long videoId;

    private Long userId;

    private Long parentId;

    @NotBlank(message = "评论内容不能为空")
    @Length(min = 1, max = 500, message = "评论内容长度必须在1-500之间")
    private String content;

    private Integer likeCount;

    private Integer replyCount;

    private Integer status;

    private LocalDateTime createTime;

    private LocalDateTime updateTime;

    // 用户昵称和头像，用于返回给前端展示
    private String username;
    private String avatar;
}